fix(whp-gui): window resize scales the picture (real-hardware finding: cage keeps native mode)#120
Merged
Merged
Conversation
Real-hardware validation of #118's WHP dynamic-resolution path on this box (gui-demo/xeyes, CHEFER_WHP_TRACE_GPU=1) showed the device→interrupt→guest half works — resizing to 1024x845 produced, in order: `requesting guest mode 1024x845` → guest `GET_DISPLAY_INFO/GET_EDID -> 1024x845` → `events_clear 0x1`. But `cage` (a fixed-mode kiosk compositor) does NOT re-modeset on an online mode change: the driver re-reads display info, userspace ignores it, and scanout flushes stay at the native 1280x800. Forcing it via a disconnect→reconnect "replug" (report scanout disabled, then re-enabled) does make cage react — by tearing down the output, which exits the interface app and fail_fast kills the whole app. So a live guest re-modeset is not achievable with cage. Ship the honest, stable behavior instead: the host window resizes freely and the picture scales (StretchDIBits). gui_window replaces the pending-resize/timeout machinery (which assumed the guest would re-modeset and briefly paused resize-to-content) with a one-way `user_sized` latch: once the user resizes, resize-to-content is disabled permanently so the window never snaps back; absolute pointer coords still map by window ratio, so input stays correct. The device-side config-change signal is kept and unit-tested — it is correct and future-compatible: swapping cage for a mode-following compositor enables true re-modeset with no device changes. Added CHEFER_WHP_TRACE_GPU traces on GET_DISPLAY_INFO / GET_EDID / events_clear for this kind of diagnosis. whp-helper 120 unit tests green locally (Windows-native build); the resize test now asserts the scanout stays enabled (never simulate disconnect). DESIGN/README updated to the validated behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Real-hardware validation of the WHP dynamic-resolution path from #118, run on this Windows box (gui-demo/xeyes,
CHEFER_WHP_TRACE_GPU=1).What the hardware showed
Resizing the window to 1024×845 produced, in order:
→ the device → config interrupt → guest-driver re-read half works end to end. But
scanout flushstayed 1280×800:cage(a fixed-mode kiosk compositor) does not re-modeset on an online mode change. Forcing it via a disconnect→reconnect "replug" does make cage react — by tearing down the output, which exits the interface app andfail_fastkills the whole app. So a live guest re-modeset isn't achievable with cage.The fix (ship the honest, stable behavior)
Host window resizes freely; the picture scales (
StretchDIBits).gui_windowdrops the pending-resize/timeout machinery (which assumed the guest would re-modeset and briefly paused resize-to-content) for a one-wayuser_sizedlatch: once the user resizes, resize-to-content is disabled permanently → the window never snaps back; absolute pointer coords still map by window ratio, so input stays correct.The device-side config-change signal is kept and unit-tested — correct and future-compatible: swapping cage for a mode-following compositor enables true re-modeset with no device changes. Added
CHEFER_WHP_TRACE_GPUtraces on GET_DISPLAY_INFO / GET_EDID / events_clear for this diagnosis.Validation
🤖 Generated with Claude Code